package pl.edu.mimuw.mas.ontology.concept;

import jade.content.Concept;

import java.text.SimpleDateFormat;
import java.util.Date;

public class LogEntry implements Concept {
	private static final long serialVersionUID = 639717740542523864L;

	private static final SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
	
	private String agentId;
	private String value;
	private Date date;
	
	public LogEntry() {	}

	public LogEntry(String agentId, String value) {
		this.agentId = agentId;
		this.value = value;
		this.date = new Date();
	}

	public String getAgentId() {
		return this.agentId;
	}

	public void setAgentId(String agentId) {
		this.agentId = agentId;
	}
	
	public String getValue() {
		return this.value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}
	
	public String toString() {
		StringBuilder sb = new StringBuilder(300);
		sb.append(formatter.format(date));
		sb.append(" ");
		sb.append(agentId);
		sb.append(" : ");
		sb.append(value);
		
		return sb.toString();
	}
}
